﻿<%@ Page Title="" Language="C#" MasterPageFile="/Administrator/Site1.Master" AutoEventWireup="true"
    CodeBehind="ManagerCat.aspx.cs" Inherits="TIS.Administrator.ManagerCat" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="workplace">
        
                            Ngôn ngữ
                     
                                                    <asp:DropDownList runat="server" ID="ddlLanguage">
                            </asp:DropDownList>
                        
                        
                            <asp:Button runat="server" CssClass="btn" Height="32px" ID="btnLoadGrid" Text="Chọn ngôn ngữ" OnClick="btnLoadGrid_Click" />
                                                <div class="clear">
        <asp:Button ID="Button1" CssClass="btn" Height="32px" PostBackUrl="/Administrator/Home.aspx" runat="server" Text="Thêm mới danh mục" />
        <asp:Button ID="Button2" CssClass="btn" Height="32px" PostBackUrl="/Administrator/AddNews.aspx" runat="server" Text="Thêm mới tin tức" />

                        </div>
        <div class="row-fluid">
            <div class="span12">
                <div class="head">
                    <div class="isw-grid">
                    </div>
                    <h1>
                        Danh sách danh mục</h1>
                    <div class="clear">
                    </div>
                </div>
                <div class="block-fluid table-sorting">
                    <div class="row-form">
                        
                        <div class="row-form">
                        <asp:Literal ID="ltlMessage" runat="server"></asp:Literal>
                        <div class="clear">
                        </div>
                    </div>
                        <div class="clear">
                        </div>
                        <div class="row-form">
                            <asp:GridView ID="grvCategory" runat="server" AutoGenerateColumns="False" CellPadding="4"
                            ForeColor="#333333" GridLines="None" Width="100%" AllowPaging="True" onpageindexchanging="grvCategory_PageIndexChanging" 
                            >
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            <Columns>
                                <asp:ImageField DataImageUrlField="CategoryImage" HeaderText="Hình Ảnh">
                                    <ControlStyle Height="50px" Width="50px" />
                                    <ItemStyle Height="50px" Width="50px" HorizontalAlign="Center" />
                                </asp:ImageField>
                                <asp:BoundField DataField="CategoryName" HeaderText="Danh mục">
                                    <ItemStyle HorizontalAlign="Center" Width="150px"></ItemStyle>
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="Hiển thị">
                                    <ItemTemplate>
                                        <asp:Label ID="lblDisplay" runat="server" 
                                            Text='<%# Convert.ToInt32(Eval("CategoryDisplayCenter")) == 1 ? "Top đầu" : "Giữa trang" %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" Width="150px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Hiển thị khung giữa">
                                    <ItemTemplate>
                                        <asp:Label ID="ltlTopDisplay" runat="server" 
                                            Text='<%# Convert.ToInt32(Eval("CategoryParent")) == 1 ? "Hoạt động" : "Không hoạt động" %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" Width="150px" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="CategoryPosition" HeaderText="Vị trí">
                                <FooterStyle HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="Tình trạng">
                                    <ItemTemplate>
                                        <asp:Label ID="ltlStatus" runat="server" 
                                            Text='<%# Convert.ToInt32(Eval("CategoryStatus")) == 1 ? "Hoạt động" : "Không hoạt động" %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" Width="150px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Hành động">
                                    <ItemStyle HorizontalAlign="Center" Width="100px" />
                                    <ItemTemplate>
                                     <asp:LinkButton ID="lbtnEdit" runat="server" CommandArgument='<%# Eval("CategoryId") %>'
                                            OnCommand="lbtnEdit_Command">Sửa</asp:LinkButton>
                                             &nbsp;|
                                        <asp:LinkButton ID="lbtnRemove" runat="server" CommandArgument='<%# Eval("CategoryId") %>'
                                            OnClientClick="return confirm('Bạn có thực sự muốn xóa không ?')" 
                                            OnCommand="lbtnRemove_Command">Xóa</asp:LinkButton>
                                       
                                       
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EditRowStyle BackColor="#999999" />
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#E9E7E2" />
                            <SortedAscendingHeaderStyle BackColor="#506C8C" />
                            <SortedDescendingCellStyle BackColor="#FFFDF8" />
                            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                        </asp:GridView>
                        </div>
                    </div>
                    <div class="clear">
                    </div>
                </div>
            </div>
        </div>
        <div class="dr">
            <span></span>
        </div>
    </div>
</asp:Content>
